export default {
	namespaced: true,
	state: () => ({
		test: 'abc',
		search_history: JSON.parse(uni.getStorageSync('search_history') || '[]')
	}),
	mutations: {
		saveToStorage(state) {
			uni.setStorageSync('search_history', JSON.stringify(state.search_history))
		},
		deleteToStorage(state) {
			uni.removeStorageSync('search_history')
		},
		updateHistory(state, search_history) {
			state.search_history = search_history
			this.commit('m_medicine/saveToStorage')
		},
		deleteHistory(state) {
			this.commit('m_medicine/deleteToStorage')
			state.search_history = []
		}
	},
	getters: {}
}